function Item({ name, eatif }) {
  let eated
  // if(eatif) eated = "吃饱了"
  // else eated = "准备吃啥"

  // 三元运算符
  eated = eatif ? "吃饱了" : "准备吃啥"

  //  // && 逻辑与
  // eated = eatif && "吃饱了"

  return (
    <div>
      <h2>{name} {eated}</h2>
    </div>
  )
}
export default function Condition() {
  return (
    <div>
      <h1>条件渲染</h1>
      <Item name="小明" eatif={true}></Item>
      <Item name="小红" eatif={false}></Item>
    </div>
  )
}